package base.thread_demo.demo08_07;

/**
 * 通过反编译工具查看下内外部类关系
 */
public class OuterClassDemo {

    //final InnerClass inner = new OuterClassDemo().new InnerClass();// StackOverflowError
    static InnerClass inner = new OuterClassDemo().new InnerClass();

    public static void main(String[] args) {
        InnerClass inner1 = new OuterClassDemo().getInner();
        InnerClass inner2 = new OuterClassDemo().getInner();

        System.out.println(inner1);//OuterClassDemo$InnerClass@452b3a41
        System.out.println(inner2);//OuterClassDemo$InnerClass@452b3a41

        System.out.println(inner1.equals(inner2));//true
        System.out.println(inner1 == inner2);//true
    }


    public OuterClassDemo.InnerClass getInner(){
        return inner;
    }

    class InnerClass{}
}
